package com.springboot.demo.error;
//包装器异常类实现
public class BusinessException extends Exception implements  CommonError{

    private CommonError commonError;
    //直接接收commonError的传参用来构造业务异常
    public BusinessException (CommonError commonError){
        super();
        this.commonError = commonError;
    }

    //接收自定义errmsg
    public BusinessException (CommonError commonError,String errorMsg){
        super();
        this.commonError = commonError;
        this.setErrMsg(errorMsg);
    }
    @Override
    public int getErrCode() {
        return 0;
    }

    @Override
    public String getErrMsg() {
        return null;
    }

    @Override
    public CommonError setErrMsg(String errMsg) {
        return null;
    }
}
